package com.ace.slide.client.ui;

import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;

public class ProfileTab extends TabItem{
	private Button saveChangesButton;
	private FormPanel profileEditForm;
	
	private TextField<String> firstName;
	private TextField<String> lastName;
	private TextField<String> email;
	
	public ProfileTab()  {
		
		setClosable(true);
		setText("Profile");
		setTitle("Profile");
		setId("profileTab");
		
		createProfileEditForm();
	}
	
	private void createProfileEditForm()  {
		firstName = new TextField<String>();
		firstName.setFieldLabel("First Name:");
		
		lastName = new TextField<String>();
		lastName.setFieldLabel("Last Name:");
		
		email = new TextField<String>();
		email.setFieldLabel("Email Address:");
		
		saveChangesButton = new Button("Save Changes");
		saveChangesButton.setVisible(true);
		
		profileEditForm = new FormPanel();
		profileEditForm.setHeading("Edit Your Profile Details:");
		profileEditForm.add(firstName);
		profileEditForm.add(lastName);
		profileEditForm.add(email);
		profileEditForm.addButton(saveChangesButton);
		add(profileEditForm);
	}
}
